package com.dycc.main_componet.adapter;

import android.content.Context;
import android.view.View;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.dycc.main_componet.R;
import com.dycc.main_componet.adapter.bean.Rc_Menu;
import com.dycc.main_componet.adapter.holder.Rc_MenuHolder;

import java.util.List;

/**
 * 推荐页面-菜单适配器
 * Created by wxk on 2018/1/26 0026.
 */

public class Rc_MenuAdapter extends BaseQuickAdapter<Rc_Menu, Rc_MenuHolder> {
    Context context;
    onMenuClickListener rcListener;

    public Rc_MenuAdapter(Context context, List<Rc_Menu> menus) {
        super(R.layout.rc_menu_layout, menus);
        this.context = context;
    }

    @Override
    protected void convert(Rc_MenuHolder helper, Rc_Menu item) {
        helper.getRcMenuItemName().setText(item.getTitle() + "");
        Glide.with(context).load(item.getIcon()).placeholder(R.drawable.pic_defaultholder).into(helper.getRcMenuItemImage());

    }

    public interface onMenuClickListener {
        void onMenuClick(View view, Rc_Menu menu);
    }
}
